<div class="blade-static __bottom" ng-include="'$(Platform)/Scripts/common/templates/ok-cancel2.tpl.html'"></div>
<div class="blade-content">
    <div class="blade-inner">
        <div class="inner-block form">
            <div class="form-group">
                <label class="form-label">{{ 'platform.blades.oauthapps.labels.clientId' | translate }}</label>
                <div class="form-input">
                    <input ng-model="blade.currentEntity.clientId" id="clientId" placeholder="{{ 'platform.blades.oauthapps.placeholders.clientId' | translate }}" ng-readonly="!blade.isNew" required focus-on>
                    <button class="btn __ico" type="button" ng-click="copyToClipboard('clientId')" title="{{ 'platform.commands.copy' | translate }}">
                        <i class="btn-ico fas fa-paste"></i>
                    </button>
                </div>
            </div>

            <div ng-if="blade.isNew" class="form-group">
                <label class="form-label form-error"> {{ 'platform.blades.oauthapps-detail.labels.clientSecret-warning' | translate }} </label>
                <div class="form-input">
                    <input ng-model="blade.currentEntity.clientSecret" id="clientSecret" placeholder="{{ 'platform.blades.oauthapps.placeholders.clientSecret' | translate }}">
                    <button class="btn __ico" type="button" ng-click="copyToClipboard('clientSecret')" title="{{ 'platform.commands.copy' | translate }}">
                        <i class="btn-ico fas fa-paste"></i>
                    </button>
                </div>
            </div>

            <div class="form-group">
                <label class="form-label">{{ 'platform.blades.oauthapps.labels.displayName' | translate }}</label>
                <div class="form-input">
                    <input ng-model="blade.currentEntity.displayName" placeholder="{{ 'platform.blades.oauthapps.placeholders.displayName' | translate }}">
                </div>
            </div>

            <div class="form-group">
                <label class="form-label">{{ 'platform.blades.oauthapps.labels.type' | translate }}</label>
                <div class="form-input">
                    <input ng-model="blade.currentEntity.type" placeholder="{{ 'platform.blades.oauthapps.placeholders.type' | translate }}" readonly>
                </div>
            </div>

            <div class="form-group">
                <fieldset>
                    <legend>
                        {{ 'platform.blades.oauthapps.labels.redirectUris' | translate }}
                        <a href="" ng-click="editRedirectUris(blade.currentEntity.redirectUris)" class="form-edit">
                            <i class="form-ico fa fa-pencil"></i>
                        </a>
                    </legend>
                    <div ng-if="blade.currentEntity.redirectUris.length > 0" class="table-wrapper">
                        <form name="formScope" class="form">
                            <table class="table __indexed">
                                <thead>
                                    <tr>
                                        <th class="table-col">{{ 'platform.blades.oauthapps-detail.labels.urls' | translate }}</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr class="table-item" ng-repeat="uri in blade.currentEntity.redirectUris track by $index">
                                        <td class="table-col">
                                            <div class="form-input">
                                                <input ng-model="uri" type="text" readonly />
                                            </div>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </form>
                    </div>
                </fieldset>
            </div>

            <div class="form-group">
                <fieldset>
                    <legend>
                        {{ 'platform.blades.oauthapps.labels.postLogoutRedirectUris' | translate }}
                        <a href="" ng-click="editPostLogoutRedirectUris(blade.currentEntity.postLogoutRedirectUris)" class="form-edit">
                            <i class="form-ico fa fa-pencil"></i>
                        </a>
                    </legend>
                    <div ng-if="blade.currentEntity.postLogoutRedirectUris.length > 0" class="table-wrapper">
                        <form name="formScope" class="form">
                            <table class="table __indexed">
                                <thead>
                                    <tr>
                                        <th class="table-col">{{ 'platform.blades.oauthapps-detail.labels.urls' | translate }}</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr class="table-item" ng-repeat="uri in blade.currentEntity.postLogoutRedirectUris track by $index">
                                        <td class="table-col">
                                            <div class="form-input">
                                                <input ng-model="uri" type="text" readonly />
                                            </div>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </form>
                    </div>
                </fieldset>
            </div>

        </div>
    </div>
</div>
